/*
 * @Author: 晟松
 * @Date: 2021-11-30 15:44:10
 * @LastEditors: 晟松
 * @LastEditTime: 2022-03-06 16:12:03
 * @FilePath: \mini-vue3d:\Code\node\koa2\volunteer-service\src\main\middleware\jwt.js
 * @Description: 
 */
// src/main/middleware/jwt.js
import koajwt from 'koa-jwt';
import config from '@main/config';

export default () => {
  return koajwt({ secret: config.jwt.secret })
    .unless({
      path: [
        /^\/api\/login/,
        /^\/test/,
        /^\/api\/user\/create/,
        /^\/api\/user\/info/,
        /^\/api\/upload/,
        /^\/api\/web3/,
        /^\/api\/user\/getAllCommunity/,
        /^\/api\/user\/getAllSchool/,
        // /^\w/
      ]
    })
};
